<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<style type="text/css">
    *{
        padding:0;
        margin:0;
    }
    .box{
        margin:0 auto;
    	width:780px;
    	height:550px;
    	background-image: url(bg.png);
        box-sizing:border-box;
        padding:455px 270px 0px;
        box-sizing:border-box;
    }
    #btn{
        display: inline-block;
        width:260px;
        height:50px;
        background-color:pink;
        text-align: center;
        line-height:50px;
        color:#fff;
        font-size:25px;

    }
	</style>
	<script type="text/javascript">
    window.onload = function (){
    	//获取节点
    	var btn = document.getElementById("btn");
    	//节点添加事件
    	btn.onclick = function(){
    		//申明一个随机数
    		var num = Math.ceil(Math.random()*10);
    		if(num==8){
             alert("恭喜你中了一等奖");
    		}else if(num == 2 || num == 6){
             alert("恭喜你中了二等奖");
    		}else if(num == 5){
    			alert("恭喜你中了二等奖");
    		}else{
    			alert("不要灰心再来一次");
    		}
    	}
    }
	</script>
</head>
<body>
	 <div class="box">
	<button id="btn">点击开始抽奖</button>
	</div>
</body>
</html>